uDig

«  What to Do Next   ::   Contents   ::   GeoScript Introduction  »

Introduction to the Spatial Toolbox

The Spatial Toolbox View gives the possibility to execute tools from loaded libraries on resources visualized in uDig.

Introduction to the Spatial Toolbox

Before you Start

Download the Spearfish example data

The Spatial toolbox View

Installing JGrasstools

Processing

Generating Aspect of an Elevation Model

Things to Try

Related reference

Spatial Toolbox view

This is how it looks like when it is enabled:

Before you Start

Download the Spearfish example data

In the example we will use a raster elevation model of the Spearfish region.

  1. Download the following file (you can right click and choose Save as in most browsers):

    spearfish_elevation.zip (spearfish_elevation.zip)

  2. Unzip it to your data directory or desktop

  3. This download contains:

    • elevation.asc
    • elevation.prj
  4. Try to drag it into uDig and see if it look like the following:

The Spatial toolbox View

Once your raster is loaded you are ready to start to configure the spatial toolbox. First let’s open it up:

  1. Find it under Window ‣ Show View ‣ Other...

  2. And then choose the Spatial toolbox:

  3. It will probably open up a bit too small, so best thing is to detach it and use it in a separate window anyways.

  4. To do so right click on the view’s bar:

  5. And voila’!

Installing JGrasstools

The spatial toolbox is able to load and generate graphical user interfaces and link together models that are developed as OMS3 services.

Note

OMS3

Object Modeling Services 3 is a standard used for component development employed by the jgrass project. If you are interested in the details please have a look here:

To load the modules:

  1. Currently one library of spatial tools implemented using OMS3 is the jgrasstools library.

  2. Therefore it is possible to jump on the jgrass website to get a processing library to use it in uDig.

  3. At the time of writing the jgrass 0.7.1 library is packaged and available for use

  4. To start to have some fun we need to download two jar files:

  5. You can download these two files anywhere; for today we will be placing them in a “jgrass” folder in your home directory.

  6. Create a “jgrass” folder in your home directory

  7. Download the above two files and place them in the jgrass folder

  8. Then push the last icon of the toolbar:

  9. Which will open the settings dialog:

  10. The settings dialog allows you to load the libraries by using the + button.

  11. Load the two libraries that you downloaded.

  12. It should, apart of the different paths of the files, like like the following:

  13. Once you push the ok button, uDig will search for modules inside the library

  14. Congratulations; the toolbox should now display the modules that were found

Processing

The jgrass project provides a host of valuable processes you can try out; for now we will start with a simple example.

Generating Aspect of an Elevation Model

To try out spatial processing we will simply create a map of aspect using the elevation model you already loaded from the sample dataset.

  1. Type in the search box the letters: asp

  2. The “Aspect” module should appear in the list:

  3. Please select the Aspect module so we can describe the tabs used to control a service.

  4. inputs tab:

    ../_images/spatial_toolbox_12.png

    outputs tab

    ../_images/spatial_toolbox_13.png

    documentation tab

  5. We will now set up the Aspect service to work with our sample digital elevation model.

  6. To define the input raster to process, simply push the input data button.

    • A raster reader dialog will open.

    • You could browse for the raster, but the simplest thing is to drag the raster map from the udig layer view into the textfield and let udig do the rest.

      ../_images/spatial_toolbox_14.png
  7. Output data

    • In the case of the output data, we can’t drag an existing map, so we will have to use the browse button, which will open in the same folder of the last inserted map.

    • There we simply write aspect.asc to create an esri ascii also as output \ (other formats supported are tiffs and grass binary rasters)

      ../_images/spatial_toolbox_15.png
  8. Configure

    • Before we run the module there are a couple of configuration options that are useful to control.

    • The most important is the amount of memory that we permit the module to use:

      ../_images/spatial_toolbox_16.png
  9. In the above example the local machine has 8 gigabytes of RAM, allowing us to easily allocate 2000 megabytes for for the work

  10. Execute the module

    • To execute the module please click the run button in the view toolbar

      ../_images/spatial_toolbox_17.png
    • The module will execute opening a console window that gives feedback on what is going on.

  11. Once the process is done, the resulting map is loaded in the map window:

    ../_images/spatial_toolbox_18.png

Things to Try

Congratulations on finishing this tutorials; here are a couple of things to try:

  • Review the documentation of some of the other services made available
  • Check out the jgrass website for additional information about the project

«  What to Do Next   ::   Contents   ::   GeoScript Introduction  »